function register(){
    let id = document.getElementById("id").value
    let username = document.getElementById("username").value
    let email = document.getElementById("email").value
    let password = document.getElementById("password").value
    let repassword = document.getElementById("password_").value
    // let direction = document.getElementById("direction").value
    if(password != repassword){
        console.log(password,repassword)
        alert("请检查两次输入的密码！")
    }else{
        console.log(typeof(id))
        console.log(typeof(password))
        console.log(typeof(email))
        $.ajax({
            url: 'http://81.68.240.146:5256/book/register/',
            type: 'POST',
            data: JSON.stringify({          
                's_pwd':password,
                's_id':id,
                's_email':email,
                'username':username,
                // 'g_id':direction
            }),
            contentType:"application/JSON;charset=UTF-8",
            dataType:'json',
            Headers:{
                withCredential:true
            },
            success: function(data) { // 接口调用成功回调函数
                // data 为服务器返回的数据
                console.log(data)
                // 如果注册成功 去登陆页面
            },
            Error:function(data){
                alert('no')
            }
        });
    }    
}

// $("#demoCombo").combobox({editable:false});

function a(){
    $.ajax({
        url: 'http://81.68.240.146:5256/book/user/',
        type: 'get',
        // data: JSON.stringify({          
        //     's_pwd':password,
        //     's_id':id,
        //     's_email':email,
        //     'username':username,
        //     // 'g_id':direction
        // }),
        contentType:"application/JSON;charset=UTF-8",
        dataType:'json',
        Headers:{
            withCredential:true
        },
        success: function(data) { // 接口调用成功回调函数
            // data 为服务器返回的数据
            console.log(data)
        },
        Error:function(data){
            alert('no')
        }
    });
}